#ifndef ITEMITEM_H
#define ITEMITEM_H

#include <QObject>
#include "baza/grupa.h"

class ItemItem: public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString name READ name WRITE setName NOTIFY dataChanged)
    Q_PROPERTY(int itemId READ itemId)
    Q_PROPERTY(int groupId READ groupId WRITE setGroupId NOTIFY dataChanged)
    Q_PROPERTY(QString groupName READ groupName WRITE setGroupName NOTIFY dataChanged)
    Q_PROPERTY(bool isAGroup READ isAGroup)
    Q_PROPERTY(int index READ index)
    Q_PROPERTY(int groupNumber READ groupNumber)

public:
    explicit ItemItem(QObject *parent = 0);
    ItemItem(int itemId, QString name, Grupa group, int index, bool isAGroup, int groupNumber);
    ~ItemItem();

    QString name();
    int itemId();
    int groupId();
    QString groupName();

    int index();
    bool isAGroup();
    int groupNumber();

public slots:
    void setName(QString newName);
    void setGroupId(int newGroupId);
    void setGroupName(QString newGroupName);

 private:
    QString m_name;
    int m_ItemId;
    int m_GroupId;
    QString m_GroupName;

    int m_index;
    bool m_isAGroup;

    int m_GroupNumber;

signals:
    void dataChanged();

};

#endif // ITEMITEM_H
